import { coreMixin } from './scroll/core'
import { initMixin } from './scroll/init'
import { eventMixin } from './scroll/event'
import { pullDownMixin } from './scroll/pullDown'
import { pullUpMixin } from './scroll/pullUp'
import { snapMixin } from './scroll/snap'

function GScroll (el, options) {
  // 查找绑定节点
  this.wrapper = document.getElementById(el)
  this.scroller = this.wrapper.children[0]

  // 缓存scroll样式
  this.scrollerStyle = this.scroller.style

  // 初始化私有的自定义事件
  this._events = {}

  // 根据options执行初始化
  this._init(options)
}

coreMixin(GScroll)
initMixin(GScroll)
eventMixin(GScroll)
pullDownMixin(GScroll)
pullUpMixin(GScroll)
snapMixin(GScroll)

export default GScroll
